CREATE TABLE [dbo].[TTRUBR_FINA]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_ARUB] [dbo].[TD_VC_003] NOT NULL,
[CO_RUBR] [dbo].[TD_VC_003] NOT NULL,
[DE_RUBR] [dbo].[TD_VC_100] NULL,
[ST_REPO] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TTRUBR_FI__ST_RE__76226739] DEFAULT ('N'),
[NU_ORDE] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTRUBR_FI__NU_OR__780AAFAB] DEFAULT ((0)),
[ST_DETA] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TTRUBR_FI__ST_DE__78FED3E4] DEFAULT ('N'),
[ST_TOTA] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TTRUBR_FI__ST_TO__79F2F81D] DEFAULT ('N'),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTRUBR_FI__CO_US__7BDB408F] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTRUBR_FI__FE_US__7CCF64C8] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTRUBR_FI__CO_US__7DC38901] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTRUBR_FI__FE_US__7EB7AD3A] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTRUBR_FINA] WITH NOCHECK ADD CONSTRAINT [CK__TTRUBR_FI__ST_RE__77168B72] CHECK NOT FOR REPLICATION (([ST_REPO]='N' OR [ST_REPO]='S'))
GO
ALTER TABLE [dbo].[TTRUBR_FINA] WITH NOCHECK ADD CONSTRAINT [CK__TTRUBR_FI__ST_TO__7AE71C56] CHECK NOT FOR REPLICATION (([ST_TOTA]='N' OR [ST_TOTA]='S'))
GO
ALTER TABLE [dbo].[TTRUBR_FINA] ADD CONSTRAINT [PK__TTRUBR_F__3C9F43577C1B37B1] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_ARUB], [CO_RUBR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTRUBR_FINA] ADD CONSTRAINT [FK__TTRUBR_FINA__6B45B16A] FOREIGN KEY ([CO_EMPR], [CO_ARUB]) REFERENCES [dbo].[TTARUB_FINA] ([CO_EMPR], [CO_ARUB])
GO
